package com.burstly.lib.component.preinitialize;

import com.burstly.lib.component.AdaptorFactoryCache;
import com.burstly.lib.feature.networks.IAdaptorFactory;
import com.burstly.lib.util.LoggerExt;
import java.lang.reflect.Constructor;
import java.util.Map;

public final class PreinitializeManager
{
  private static final LoggerExt LOG = LoggerExt.getInstance();
  private static final String TAG = "PreinitializeManager";

  public static void preinitializeAdaptor(String paramString, Map<String, ?> paramMap)
  {
    if (paramString == null)
    {
      LOG.logWarning("PreinitializeManager", "Could not preinitialize null class name", new Object[0]);
      return;
    }
    try
    {
      Constructor localConstructor = Class.forName(paramString).getConstructor(new Class[0]);
      localConstructor.setAccessible(true);
      IAdaptorFactory localIAdaptorFactory = (IAdaptorFactory)localConstructor.newInstance(new Object[0]);
      localIAdaptorFactory.initialize(paramMap);
      AdaptorFactoryCache.cacheFactory(paramString, localIAdaptorFactory);
      return;
    }
    catch (ClassNotFoundException localClassNotFoundException)
    {
      LOG.logError("PreinitializeManager", "Could not preinitialize {0} because this class can not be found in classpath.", new Object[] { paramString });
      return;
    }
    catch (ClassCastException localClassCastException)
    {
      LOG.logError("PreinitializeManager", "Could not preinitialize {0} because it does not implement com.burstly.lib.component.networkcomponent.IAdaptorFactory interface.", new Object[] { paramString });
      return;
    }
    catch (Exception localException)
    {
      LOG.logThrowable("PreinitializeManager", localException);
    }
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.burstly.lib.component.preinitialize.PreinitializeManager
 * JD-Core Version:    0.6.2
 */